package com.eshop.eshopcache.kafka;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.kafka.core.KafkaTemplate;
import org.springframework.stereotype.Component;

/**
 * @author: Xukai
 * @description:
 * @createDate: 2018/7/26 10:19
 * @modified By:
 */
@Component
public class KafkaSender {

    @Autowired
    private KafkaTemplate kafkaTemplate;

    /**
     * 发送消息到kafka
     */
    public void send(String topic, String data) {
        kafkaTemplate.send(topic, data);
    }
}
